package com.tyut.musicdreamer.framework.starter.convention.exception;

import lombok.Getter;

/**
 * 抽象项目异常基类
 */
@Getter
public abstract class AbstractException extends RuntimeException {

    protected String errorCode;
    protected String errorMessage;

    protected AbstractException(String message) {
        super(message);
        this.errorMessage = message;
    }

    protected AbstractException(String errorCode, String errorMessage) {
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    protected AbstractException(String errorCode, String errorMessage, Throwable cause) {
        super(errorMessage, cause);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    protected AbstractException(Throwable cause) {
        super(cause.getMessage(), cause);
        this.errorMessage = cause.getMessage();
    }
}
